include:
  - lighttpd
  - php
  - php.codesniffer
  - php.fpm
  - php.opcache
  - httpd.optimization

# Configure lighttpd/php specific check script
Setup lighttpd check script:
  file.managed:
    - name: /root/check_lighttpd.sh
    - source: salt://webserver/check_lighttpd.sh

Create crontab file for lighttpd check script if not exist:
  file.managed:
    - name: /root/crontab.txt

Insert lighttpd check script into crontab:
  file.blockreplace:
    - name: /root/crontab.txt
    - marker_start: "# START saltstack generated crontab entries (for webeserver)"
    - marker_end:   "# END   saltstack generated crontab entries (for webeserver)"
    - content: '* * * * * /root/check_lighttpd.sh'
    - backup: '.bak'
    - append_if_not_found: True

  cmd.run:
    - name: crontab /root/crontab.txt

